package com.le.tester.imooc.masterJUC.collections.predecessor;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * 描述：collections中的synchronizeList(new ArrayList<E>())
 */
public class SynList {
    public static void main(String[] args) {
        //变成了线程安全
        List<Integer> list = Collections.synchronizedList(new ArrayList<>());
        list.add(1);
        System.out.println(list.get(0));
    }
}
